Skip to content

Fix filtering query #6554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2025
Merged

Fix filtering query #6554

merged 1 commit into from
Mar 11, 2025

Conversation

akatsoulas
Copy link
Collaborator

No description provided.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This pull request updates the filtering query for flagged objects by revising the logic used for filtering on the product slug associated with a content model.

  • Removed the manual iteration and filtering by flagged object IDs.
  • Introduced a direct ORM query on the content model to filter based on the product slug.

Reviewed Changes

File Description
kitsune/flagit/views.py Updated product filtering logic to use ORM queries

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

kitsune/flagit/views.py:43

  • The updated logic applies product filtering only if the content model has a 'product' attribute. It would be beneficial to handle or document the case where a product_slug is provided but the content model lacks the 'product' attribute to avoid silent failures.
model_class = content_model.model_class()

@akatsoulas akatsoulas merged commit 4b18f70 into mozilla:main Mar 11, 2025
1 check passed
@akatsoulas akatsoulas deleted the optimize-queries branch March 11, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant